<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Get Customer Data</title>
<?php
    
    //customer ID
    $sID = $_GET["value"];
    
    //variable to hold customer info
    $sInfo = "";
    
    //database information
    $sDBServer = "localhost";
    $sDBName = "igymdb";
    $sDBUsername = "root";
    $sDBPassword = "";

    //create the SQL query string
    $sQuery = "Select * from usuario where nickname='$sID'";
              
    //make the database connection
    $oLink = mysql_connect($sDBServer,$sDBUsername,$sDBPassword);
    @mysql_select_db($sDBName) or $sInfo = "Unable to open database";
        
    if($sInfo == '') {
        if($oResult = mysql_query($sQuery) and mysql_num_rows($oResult) > 0) {
            $aValues = mysql_fetch_array($oResult,MYSQL_ASSOC);
            $sInfo = 'Username: '.$aValues['nickname']."<br />";
            
            
        } else {
            $sInfo = "No existe usuario";
        }
    }
    
    mysql_close($oLink);

?>
    
    <script type="text/javascript">
        window.onload = function () {
            var divInfoToReturn = document.getElementById("divInfoToReturn");
           /// top.frames["displayFrame"].displayCustomerInfo(divInfoToReturn.innerHTML);  
	parent.displayCustomerInfo(divInfoToReturn.innerHTML)
		      
        };
    
    </script>

</head>
<body>
    <div id="divInfoToReturn"><?php echo $sInfo ?></div>
</body>
</html>
